package com.maimao.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maimao.model.order.Order;
import com.maimao.model.order.OrderGoods;
import com.maimao.model.order.es.EsOrderGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2021/1/18 5:47 下午
 */
@Mapper
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
    /**
     * 根据订单id查询赠送积分
     */
    List<OrderGoods> selectSkuIdAndIntegralByOrderId(@Param("orderId")Long orderId);
    List<OrderGoods> selectByOrderShopId(@Param("orderShopId")Long orderShopId);
    List<EsOrderGoods> selectEsByOrderShopId(@Param("orderShopId")Long orderShopId);

    int changeShipStatus(@Param("id") Long id,@Param("shipStatus") Integer shipStatus);


    List<OrderGoods> selectShipStatusByOrderShopId(@Param("orderShopId") Long orderShopId);

    int receiveGoods(@Param("id") Long id, @Param("reveiveTime") LocalDateTime now);

    int updateCommentStatus(@Param("orderId") Long orderId, @Param("skuId") Long skuId, @Param("status") Integer status);

    OrderGoods selectCommentBySkuIdAndOrderId(@Param("skuId") Long skuId, @Param("orderId") Long orderId);
}
